import { addList } from '../api/index'

export let add_List = () => {
    return async dispatch => {
        let { data } = await addList()
        dispatch({
            type: 'ADD_LIST',
            payload: data
        })
    }
}

export let add_Item = (obj) => {
    return dispatch => {
        dispatch({
            type: 'ADD_ITEM',
            payload: obj
        })
    }
}

export let delete_Item = (index) => {
    return dispatch => {
        dispatch({
            type: 'DELETE_ITEM',
            payload: index
        })
    }
}

export let edit_Item = (obj) => {
    return dispatch => {
        dispatch({
            type: 'EDIT_ITEM',
            payload: obj
        })
    }
}